package com.magic.cd.enums;

/**
 * 微信消息类型
 * */
public enum MessageType {
	/**文本类型**/
	text("text","文本类型"),
	
	/**图片类型**/
	image("image","图片类型"),
	
	/**图文消息**/
	news("news","图文消息"),
	
	/**音乐消息**/
	music("music","音乐消息"),
	
	/**语音类型**/
	voice("voice","语音类型"),
	
	/**视频类型**/
	video("video","视频类型"),
	
	/**小视频类型**/
	shortvideo("shortvideo","小视频类型"),
	
	/**地理位置类型**/
	location("location","地理位置类型"),
	
	/**事件类型**/
	event("event","事件类型"),
	
	/**链接类型**/
	link("link","链接类型");
	
	private String code;
	private String msg;
	
	MessageType(String code,String msg){
		this.code = code;
		this.msg = msg;
	}
	
	public String getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	/**
	 * 验证类型是否支持
	 * @param	type	消息类型
	 * @return  boolean
	 * */
	public boolean aviable(String type){
		if(this.code.equals(type)) return true;
		return false;
	}
}
